<?php

//get environment variables
$db_user = getenv('EV_php_user');
$db_pass = getenv('EV_php_pass');
$db_name = getenv('EV_php_name');
$db_host = getenv('EV_php_host');
$db_init = "mysql:host={$db_host};dbname={$db_name};charset=utf8";

$db = new PDO($db_init, $db_user, $db_pass);

//set some db attributes
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

if (true) {
  //add modules here
  require_once 'module/users/index.php';
}

//use utils
require_once 'utils.php';

printDoc(true);
mysqlModules($db_name, false);

?>